<?php

// Information to be modified
$your_email = "lqphotographemariage@gmail.com"; // email address to which the form data will be sent
$subject = "Contact Message"; // subject of the email that is sent
$thanks_page = "thankyou.php"; // path to the thank you page following successful form submission
$thisPage = "contact.php";

// Nothing needs to be modified below this line

if (isset ( $_POST ["submit"] ) && $_POST ["submit"] == TRUE) {
	
	echo "<br>test<br>";
	$nam = $_POST ["name"];
	$ema = trim ( $_POST ["email"] );
	$com = $_POST ["comments"];
	$loadtime = $_POST ["loadtime"];
	
	if (get_magic_quotes_gpc ()) {
		$nam = stripslashes ( $nam );
		$ema = stripslashes ( $ema );
		$com = stripslashes ( $com );
	}
	
	$email_body = "Name of sender: $nam\n\n" . "Email of sender: $ema\n\n" . "COMMENTS:\n\n" . "$com";
	
	// Assuming there's no error, send the email and redirect to Thank You page
	
	mail ( $your_email, $subject, $email_body, "From: $nam <$ema>" . "\r\n" . "Reply-To: $nam <$ema>" );
	header ( "Location: $thanks_page" );
	exit ();
}
?>




<!DOCTYPE html>
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="L&Q Studio Photographe Mariage" />
<meta name="keywords"
	content="photographe, mariage, L&Q Studio, nice, cannes, antibes, paca, cote d'azur" />
<link rel="stylesheet" type="text/css" href="../style/style.css" />
<link href="../style/main.css" rel="stylesheet" type="text/css" />


<style>
.input {
	border: 2px solid red;
}
</style>


<script language="JavaScript">

	function InputCheck()
	{		 
		  if (form1.name.value == "")
		  {
				var object= document.getElementById("name"); 
				object.className = "input";
			    form1.name.focus();
			    return false;
		  }else{
			  var object= document.getElementById("name"); 
			  object.className = "";
		  }
	
		  var myreg  = /^(?:[a-z\d]+[_\-\+\.]?)*[a-z\d]+@(?:([a-z\d]+\-?)*[a-z\d]+\.)+([a-z]{2,})+$/i;
		 
		  if ( !myreg.test(form1.email.value )||form1.email.value == "" || form1.email.value == null )
		  {
			  	var object= document.getElementById("email"); 
			  	object.className = "input";
			    form1.email.focus();
			    return false;
		  }else{
			   var object= document.getElementById("name"); 
			   object.className = "";
		  }
		  
	}
</script>



<meta charset="utf-8">
<title>Nous Contacter</title>

</head>

<body>
	<div class="content">
		<h2></h2>
		<div id="menu">

			<ul id="nav">
				<li id="Contact" style="border: none;"><a href="contact.php">Contact</a></li>
				<li id="Gallerie"><a href="galerie.php">Galeries de photos</a></li>
				<li id="Acceuil"><a href="../index.php">Acceuil</a></li>
			</ul>
		</div>
		<div id="msg_slideshow" class="msg_slideshow">
			<div id="contact">
				<form id="form1" method="post"
					action="<?php $_SERVER['PHP_SELF'] ?>"
					onsubmit="return InputCheck()">
					<table>
						<tr>
							<td>
								<div style="padding-bottom: 10px;">
									<h3 align="left"
										style="color: #DDDDDD; padding-bottom: 3px; border-bottom: 1px dotted; margin-bottom: 40px;">
										Contact</h3>
									<label for="name"><font color="red">*</font>&nbsp;<font
										color="white">Nom</font> </label> <br> <input name="name"
										type="text" size="40" maxlength="60" id="name"
										value="<?php if (isset($_POST["name"])) {echo $nam;} ?>">
								</div>
								<div style="padding-bottom: 10px;">
									<label for="email"><font color="red">*</font>&nbsp;<font
										color="white">E-mail</font> </label> <br> <input name="email"
										type="email" size="40" maxlength="60" id="email"
										value="<?php if (isset($_POST["email"])) {echo $ema;} ?>">
								</div>

								<div style="padding-bottom: 10px;">
									<label for="comm"><font color="white">Message</font> </label> <br>
									<textarea name="comments" rows="10" cols="50" id="comm">
								<?php
								
								if (isset ( $_POST ["comments"] )) {
									echo $com;
								}
								?>
							</textarea>
								</div> <input type="hidden" name="loadtime"
								value="<?php echo time(); ?>">

								<div>
									<input type="submit" name="submit" value="Envoyer">
								</div>
							</td>
						</tr>
					</table>
				</form>
			</div>
		</div>
		<div id="footer">
			toutes images &copy; L&#38;Q Studio <span style="margin: 0 3px;">|</span><a
				href="menu/contact.php">contact</a> <span style="margin: 0 3px;">|</span><span
				style="color: #aaaaaa; font-family: 'Lucida Grande', Tahoma, Verdana, Arial, sans-serif; font-size: x-small;"><span
				style="line-height: 16px;">L&#38;Q Studio - Photographe de Mariage -
					Antibes, PACA France.</span></span>
		</div>
	</div>

</body>

</html>


